#include "Threadpool.hpp"
#include <functional>
#include <ctime>

using namespace std;




using func=function<void*()>;

//change name

void* task()
{
    int tmp=rand()%100+1;
    cout<<"task is "<<tmp<<endl;
    return nullptr;
}

int main()
{
    srand(time(nullptr));
    threadpool<func>* tp=threadpool<func>::GetInstance();
    tp->Init();
    int cut=100;
    while(cut--)
    {
        tp->push(task);
        sleep(1);
    }

    while(1);

    return 0;
}